home *** CD-ROM | disk | FTP | other *** search
-
- { VBELL.PAS 03-13-88 TEM Variable Sound Utility for .bat }
- { =-=-=-=-= Hz 925 and Sustain 200 are equivalent of BEEP. }
- { Turbo Pascal Version 4.0 (uses CRT unit). }
-
- program vbell;
- uses Crt;
- var
- error : integer; { In case Val function returns error }
- Hz : word;
- Sus : word;
-
- begin
- hz := 00925; { Hertz cycles per second pitch of sound }
- Sus:= 00200; { Sustain period in 1000ths of a second. }
-
- If ParamCount < 2 then
- begin
- Writeln(' ');
- Writeln(' VBELL format: vbell hertz sustain comment/ignored.');
- Writeln(' --------------------------------------------------------');
- Writeln(' Where hertz is 50 to 12000 cycles per second pitch.');
- Writeln(' sustain is 100 to 30000 for 1000ths of a second.');
- Writeln(' ');
- Writeln(' EXAMPLES: vbell 50 200 the sound you just heard.');
- Writeln(' vbell 925 200 equivalent of DOS beep. ');
- Writeln(' vbell 100 100 soft and subtle. ');
- Sound(50);
- Delay(200);
- NoSound;
- exit
- end;
-
- If ParamCount > 1 then { So 2 parms were entered }
- begin
- Val(ParamStr(1), Hz, error); { Convert string to integer }
- If error > 0 then Hz := 925; { Default if error }
- If Hz < 50 then Hz := 50; { Range checking }
- If Hz > 12000 then Hz := 12000;
- Val(ParamStr(2), Sus, error);
- If error > 0 then Sus := 200; { Default if error }
- If Sus < 100 then Sus := 100;
- If Sus > 30000 then Sus := 30000; { 30 seconds maximum }
- Sound(Hz); { Cycles per second pitch. }
- Delay(Sus); { Mileseconds to sustain sound }
- NoSound; { Required to stop sound ! }
- exit
- end;
- end.